<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>
<script type="text/javascript" src="__PUBLIC__/Admin/Js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
  function checkForm(){
    var F = document.form1;
    if( !F.goods_name.value ){
      alert("请输入商品名称");
      return false;
    }
    if( !F.goods_path.value ){
      alert("请输入商品地址");
      return false;
    }
	var str = document.getElementsByName("tags");
	var objarray = str.length;
	var chestr = "";
	for (i=0;i<objarray;i++){
	  if(str[i].checked == true){
	   chestr += str[i].value + ",";
	  }
	}
	if(chestr == ""){
	  alert("请先选择一个明星标签！");
	}else{
	  document.getElementById("tagids").value = chestr;
	}
    F.submit();
  }

  function showtags(id){
	 $.ajax({
		type:"post", //请求的方式 
		dataType:"String", //数据的格式 建议大家使用json格式 
		data:{'id':id}, //请求的数据 
		url:"__URL__/getTags/", //请求的url地址 
		success:function(json){ //请求成功时，处理返回来的数据 
		if( json ){
			$("#tagsinfo").html(json); 
		}
      } 
	})
  }
</script>
<link href="__PUBLIC__/Admin/Css/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="__PUBLIC__/Admin/images/mail_leftbg.gif"><img src="__PUBLIC__/Admin/images/left-top-right.gif" width="17" height="29" /></td>
    <td width="100%s" height="29" valign="top" background="__PUBLIC__/Admin/images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">商品管理</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="__PUBLIC__/Admin/images/mail_rightbg.gif"><img src="__PUBLIC__/Admin/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="__PUBLIC__/Admin/images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
      <table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="13" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top">
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td class="left_txt">当前位置：添加商品</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>
                  <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                    <tr>
                      <td class="left_bt2">&nbsp;&nbsp;&nbsp;&nbsp;商品设置</td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    			        <form name="form1" method="POST" action="__URL__/goodsAdd" enctype="multipart/form-data" >
                    <tr bgcolor="#f2f2f2">
                      <td width="20%" height="30" align="right" class="left_txt2">商品名称：</td>
                      <td width="3%" >&nbsp;</td>
                      <td width="32%" height="30" >
                        <input name="goods_name" type="text" size="30" value="{$editInfo[0].goods_name}"/>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品名称</td>
                    </tr>
                    <tr>
                      <td width="20%" height="30" align="right" class="left_txt2">所属明星：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30">
                        <select name="goods_star_code" class="left_txt2">
                          <option value='0'>无</option>
                          <volist name="starInfo" id="vo">
                            <option onclick="showtags({$vo.id})" value='{$vo.id}' <eq name="vo.id" value="$editInfo[0].goods_star_code">selected</eq>>{$vo.chinese_name}</option>
                          </volist>
                        </select>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品对应的明星</td>
                    </tr>
					<tr bgcolor="#f2f2f2">
                      <td width="20%" height="30" align="right" class="left_txt2">明星标签：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30" id="tagsinfo" class="left_txt2">暂无</td>
                      <td width="45%" height="30" class="left_txt">明星对应的标签</td>
                    </tr>
                    <tr>
                      <td width="20%" height="30" align="right" class="left_txt2">所属分类：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30">
                        <select name="goods_class" class="left_txt2">
                          <option value='0'>无</option>
                          <volist name="classInfo" id="vo">
                            <option value='{$vo.class_code}' <eq name="vo.class_code" value="$editInfo[0].goods_class">selected</eq>>{$vo.class_name}</option>
                          </volist>
                        </select>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品所属名称</td>
                    </tr>
					 <tr bgcolor="#f2f2f2">
                      <td width="20%" height="30" align="right" class="left_txt2">商品颜色：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30" class="left_txt2">
						<input name="goods_color" type="radio" value="0"/><span>不限</span>
                        <input name="goods_color" type="radio" value="1"/><span style="background-color:#000000;">黑色</span>
						<input name="goods_color" type="radio" value="2"/><span style="background-color:#e82835;">大红</span>
						<input name="goods_color" type="radio" value="3"/><span style="background-color:#f4d020;">姜黄</span>
						<input name="goods_color" type="radio" value="4"/><span style="background-color:#008ed0;">宝蓝</span>
						<input name="goods_color" type="radio" value="5"/><span style="background-color:#274126;">绿色</span>
						<input name="goods_color" type="radio" value="6"/><span style="background-color:#de0d85;">玫红</span>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品颜色选择</td>
                    </tr>
                    <tr>
                      <td width="20%" height="30" align="right" class="left_txt2">商品价格：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30">
						<input name="goods_price" type="text" size="30" class="left_txt2"/>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品出售价格</td>
                    </tr>
                    <tr bgcolor="#f2f2f2">
                      <td width="20%" height="30" align="right" class="left_txt2">商品图片：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30" class="left_txt2">
                        <input name="goods_photo" type="file" size="30" class="left_txt2"/>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品展示图片</td>
                    </tr>
                    <tr>
                      <td width="20%" height="30" align="right" class="left_txt2">商品地址：</td>
                      <td width="3%">&nbsp;</td>
                      <td width="32%" height="30">
                        <input name="goods_path" type="text" size="30" value="{$editInfo[0].goods_path}"/>
                      </td>
                      <td width="45%" height="30" class="left_txt">商品跳转地址</td>
                    </tr>
                    <tr>
                      <td width="100%" height="30" align="center" colspan="4">&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="100%" height="30" align="center" colspan="4">
                        <input type="hidden" value="{$editCode}" name="goods_code">
						<input type="hidden" value="" id="tagids" name="tagids">
                        <input type="button" value="确 认" name="B1" onclick="checkForm();" />&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="reset" value="重 置" name="B12" />
                      </td>
                    </tr>
                  </form>
                  </table>
                </td>
              </tr>   
            </table>
          </td>
        </tr> 
      </table>
   </td>
    <td background="__PUBLIC__/Admin/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="__PUBLIC__/Admin/images/mail_leftbg.gif"><img src="__PUBLIC__/Admin/images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="__PUBLIC__/Admin/images/buttom_bgs.gif"><img src="__PUBLIC__/Admin/images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="__PUBLIC__/Admin/images/mail_rightbg.gif"><img src="__PUBLIC__/Admin/images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>

</body>
